﻿@model PagedList.IPagedList<VOD.Models.Video>
@using VOD.Helpers;
@{
    var areaID=Request.QueryString["areaID"]??"2";
    }
<!DOCTYPE html>
<html>
<head>
    <title>综艺频道</title>
    <link href="@Url.Content("~/Content/jqueryui/ui.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Common.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Variety.css")" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="pre_miniMenu">
        <div class="miniMenu">
            <div class="leftMenu">
                <a class="miniLogo" href="@Url.Content("~")"><img src="@Url.Content("~/Content/images/logo2.png")" height="30" /></a>
                <ul>
                    <li><a href="@Url.Content("~/")">首页</a></li>
                    <li><a href="@Url.Content("~/Movie")">电影</a></li>
                    <li><a href="@Url.Content("~/TV")">电视剧</a></li>
                    <li><a href="@Url.Content("~/Cartoon")">动漫</a></li>
                    <li><a href="@Url.Content("~/Variety")">综艺</a></li>
                    @*<li><a href="@Url.Content("~/Source")">教程</a></li>*@
                    <li><a href="@Url.Content("~/Rank")">排行榜</a></li>
                    @*<li><a href="@Url.Content("~/Book")">留言簿</a></li>*@
                </ul>
            </div>
            <div class="miniSearch">
                <input class="txtSearch" type="text" />
                <input class="btnSearch" type="button" value="搜索" />
            </div>
            <div class="miniUserInfo">
                <div id="loginBox">
                    @Html.Partial("~/Views/Account/_MiniLogOnPartial.cshtml")
                </div>
            </div>
        </div>
        <div class="navArrow">
            <div class="navArrowPic"></div>
        </div>
    </div>
    <div id="Variety" class="clearfix">
        <div class="left">
            <div class="title">
                <span class="c_1">排名</span>
                <span class="c_2">节目</span>
                <span class="c_3">点播数</span>
            </div>
            @*排行榜*@
            @{Html.RenderAction("Rank");}
        </div>
        <div class="main">
            <div class="listPanel">
                <div class="title">
                    <div class="tabs_pn">
                        <a class="@(areaID=="2"?"now":"")" href="@Url.Action("Index", new { areaID=2})">内地</a>
                        <a class="@(areaID=="3"?"now":"")" href="@Url.Action("Index", new { areaID=3})">港台</a>
                        <a class="@(areaID=="5"?"now":"")" href="@Url.Action("Index", new { areaID=5})">欧美</a>
                        <a class="@(areaID=="4"?"now":"")" href="@Url.Action("Index", new { areaID=4})">日韩</a>
                        <a class="@(areaID=="1"?"now":"")" href="@Url.Action("Index", new { areaID=1})">其他</a>
                    </div>
                </div>
                <div class="content">
                    @foreach(var video in Model){
                    <div class="item">
                        <div class="photo">
                            <a href="@Url.Action("Play", "Video", new { id=video.VideoID })"><img src="@Url.Content("~/Content/Images/VideoImg/"+video.VideoID+".jpg")" height="100" width="75" /></a>
                        </div>
                        <div class="text">
                            <h5><a href="@Url.Action("Play", "Video", new { id=video.VideoID })">@video.Name</a></h5>
                            <p>
                                <span class="square"></span>
                                @Html.Truncate(video.Intro, 100)
                            </p>
                            <div class="top2">
                                @foreach(var videoUrl in video.VideoUrls.OrderByDescending(u=>u.AddDate).Take(2)){
                                <div class="p">
                                    <span><a href="@Url.Action("Play", "Video", new { id=video.VideoID,orderNum=videoUrl.VideoOrder })">@(String.Format("{0:yyyyMMdd}",videoUrl.AddDate)+" "+Html.Truncate(videoUrl.Title,10))</a></span>
                                    <a class="btn" title="点击观看 @video.Name @String.Format("{0:yyyyMMdd}",videoUrl.AddDate)" href="@Url.Action("Play", "Video", new { id=video.VideoID,orderNum=videoUrl.VideoOrder })">播放</a>
                                </div>
                                }
                            </div>
                        </div>
                    </div>
                    }
                    @*分页*@
                    @*@if (Model.PageCount > 1)
                    {*@
                    <div class="pageNum">
                        @if(Model.HasPreviousPage)
                        {
                            <a href="@Url.Content("~/Variety/Index/?page=" + (Model.PageNumber - 1))">上一页</a>
                        }
                        else
                        {
                            <a>上一页</a>
                        })
                        @for (var i = 1; i <= Model.PageCount; i++)
                        {
                            if (i == Model.PageNumber)
                            {
                                <a>@i</a>
                            }
                            else
                            {
                                <a href="@Url.Content("~/Variety/Index/?page=" + i)">@i</a>
                            }
                        }
                        @if (Model.HasNextPage)
                        {
                            <a href="@Url.Content("~/Variety/Index/?page=" + Model.PageNumber + 1)">下一页</a>
                        }
                        else
                        {
                            <a>下一页</a>
                        }
                    </div>
                    @*}*@
                </div>
            </div>
        </div>
    </div>
    @{Html.RenderAction("Footer", "Others");}
</body>
</html>
